return {
    -- LSP 基础支持
    {
        "neovim/nvim-lspconfig",
        dependencies = {
            "williamboman/mason.nvim",
            "williamboman/mason-lspconfig.nvim",
            "j-hui/fidget.nvim",
            "folke/neodev.nvim",
        },
        config = function()
            -- 导入配置文件
            require("mason").setup()
            require("mason-lspconfig").setup({
                ensure_installed = { "pyright", "ts_ls", "lua_ls", "rust_analyzer" }, -- 将 "tsserver" 替换为 "ts_ls"
            })


            -- LSP 配置
            local lspconfig = require("lspconfig")
            local on_attach = function(_, bufnr)
                -- 快捷键设置（从 keymaps.lua 导入或在此设置）
                local opts = { buffer = bufnr }
                vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
                vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
                vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
                vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
                vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
                vim.keymap.set("n", "<leader>f", vim.lsp.buf.format, opts)
                vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
                vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
                vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
            end

            -- 配置每个 LSP 服务器
            lspconfig.pyright.setup({ on_attach = on_attach })
            lspconfig.ts_ls.setup({ on_attach = on_attach }) -- 将 "tsserver" 替换为 "ts_ls"

            -- Lua 语言服务器配置
            lspconfig.lua_ls.setup({
                on_attach = on_attach,
                settings = {
                    Lua = {
                        diagnostics = { globals = { "vim" } },
                        workspace = { library = vim.api.nvim_get_runtime_file("", true) },
                        telemetry = { enable = false },
                    },
                },
            })
        end,
    },
}
